<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 动态注册
use think\Route;
// resetful资源路由
Route::resource('index', 'home/Index');//首页

Route::resource('article', 'home/Article');//文章页
// use think\Route;
//GET
// Route::get('home','index/index/index');//fan.com/home
// rule
// Route::rule('home','index/index/index');//fan.com/home
// 路由参数
// 无参
// Route::get('user', 'index/index/user');//fan.com/user/id/5
// 闭包  :id表示不要写id字串，直接写数字
// Route::get('user/:id', function($id){
//     return 'ID:' .$id;
// });
// 路由定义参数
// Route::get('userlist', 'admin/user/index',['ext'=>'html|shtml']);//fan.com/userlist
// 变量规则
// Route::get('blog/:id', 'index/blog/index',['method' => 'get'],['id' => '\d+']);//fan.com/blog/99.html
// 路由分组
// Route::group('blog',[
// 		':year/:month' => ['index/blog/article',['method' => 'get'], ['year' => '\d{4}', 'month' => '\d{2}']],
// 		':id' => ['index/log/index', ['method' => 'get'], ['id' => '\d+']],
// 		':name' => ['index/blog/read',['method' => 'get'], ['name' => '\w+']],
// 
// ]);
// 生成URL  详见tp5.com/url
// Route::get('url', 'index/index/url');
// resetful资源路由
// Route::resouce('stu', 'admin/stu');//默认生成7个资源路由
// 静态注册


use think\Route;
// 动态注册
// Route::rule('路由表达式','路由地址','请求类型','路由参数（数组）','变量规则（数组）');
//GET   后台登录页面
 Route::get('login', 'admin/login/login');
//POST 后台登录后
//  Route::post('index', 'admin/index/index');
//所有都通用
// Route::rule('ooxx', 'index/index/index');






//静态注册
return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [ 
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
